package com.qianfeng.utils;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianfeng.entity.vo.MyPage;

import java.util.ArrayList;
import java.util.List;

public class MyUtils {

    public static <T> MyPage<T> getMyPage(IPage<T> page) {
        MyPage<T> myPage = new MyPage<T>();
        myPage.setObjList(page.getRecords());
        Long pages = page.getPages();
        List<Integer> pageList = new ArrayList<>(pages.intValue());
        for (int i = 1; i <= pages; i++) {
            pageList.add(i);
        }
        myPage.setPageList(pageList);
        return myPage;
    }

}
